<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- 引入JSTL核心标签 前缀C开头 -->
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="../bootstrap/js/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="../bootstrap/js/bootstrap.min.js"></script>
<!-- 为了确保适当的绘制和触屏缩放-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码示页面</title>
</head>
<script type="text/javascript">
    $(function(){
    	$("#newPsw2").blur(function(){
    		var  newpsw1 = $("#newPsw1").val();
    		var  newpsw2 = $(this).val();
    		if(newpsw1==newpsw2){
    			 $("span").text("");
    		     $("form").attr("onsubmit","return true");
    		}else{
    			 $("span").text("请确保两次密码输入一致");
    			 $("form").attr("onsubmit","return false");
    		}
    	});
    });
</script>
<body>
     <div class="head" style="margin-left: 40px">
         <h2>个人密码修改</h2>
         <hr>
     </div>

     <div class="container" >
        <div class="row">
           <div class="col-md-5 col-md-offset-3" style="margin-top: 50px">
	         <form action="updatePassword.do" method="post" onsubmit="return false">
	            <div class="form-group">
				    <label for="exampleInputEmail1">输入当前密码</label>
				    <input type="password" class="form-control" id="oldPsw" name="oldPsw" placeholder="输入当前密码">
				</div>
				<div class="form-group">
				    <label for="exampleInputEmail1">输入新密码</label>
				    <input type="password" class="form-control" id="newPsw1" placeholder="输入新密码">
				</div>
				<div class="form-group">
				    <label for="exampleInputEmail1">输入密码</label>
				    <input type="password" class="form-control" id="newPsw2" name="newPsw2" placeholder="确认密码和新密码一致">
				    <span style="color: red"></span>
				</div>
	            <div >
	                <button type="submit" class="btn btn-primary" id="submit">确认提交</button>
	                <a href="../welcome.jsp" class="btn btn-primary" role="button">取消修改</a>
	            </div>    
	         </form>
	       </div>  
     </div>
     </div>
</body>
</html>